package com.monitor.system.service.impl;

import java.util.List;
import com.monitor.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.monitor.system.mapper.ThresholdManagementMapper;
import com.monitor.system.domain.ThresholdManagement;
import com.monitor.system.service.IThresholdManagementService;

/**
 * 阈值管理Service业务层处理
 * 
 * @author monitor
 * @date 2024-06-21
 */
@Service
public class ThresholdManagementServiceImpl implements IThresholdManagementService 
{
    @Autowired
    private ThresholdManagementMapper thresholdManagementMapper;

    /**
     * 查询阈值管理
     * 
     * @param id 阈值管理主键
     * @return 阈值管理
     */
    @Override
    public ThresholdManagement selectThresholdManagementById(Long id)
    {
        return thresholdManagementMapper.selectThresholdManagementById(id);
    }

    /**
     * 查询阈值管理列表
     * 
     * @param thresholdManagement 阈值管理
     * @return 阈值管理
     */
    @Override
    public List<ThresholdManagement> selectThresholdManagementList(ThresholdManagement thresholdManagement)
    {
        return thresholdManagementMapper.selectThresholdManagementList(thresholdManagement);
    }

    /**
     * 新增阈值管理
     * 
     * @param thresholdManagement 阈值管理
     * @return 结果
     */
    @Override
    public int insertThresholdManagement(ThresholdManagement thresholdManagement)
    {
        thresholdManagement.setCreateTime(DateUtils.getNowDate());
        return thresholdManagementMapper.insertThresholdManagement(thresholdManagement);
    }

    /**
     * 修改阈值管理
     * 
     * @param thresholdManagement 阈值管理
     * @return 结果
     */
    @Override
    public int updateThresholdManagement(ThresholdManagement thresholdManagement)
    {
        thresholdManagement.setUpdateTime(DateUtils.getNowDate());
        return thresholdManagementMapper.updateThresholdManagement(thresholdManagement);
    }

    /**
     * 批量删除阈值管理
     * 
     * @param ids 需要删除的阈值管理主键
     * @return 结果
     */
    @Override
    public int deleteThresholdManagementByIds(Long[] ids)
    {
        return thresholdManagementMapper.deleteThresholdManagementByIds(ids);
    }

    /**
     * 删除阈值管理信息
     * 
     * @param id 阈值管理主键
     * @return 结果
     */
    @Override
    public int deleteThresholdManagementById(Long id)
    {
        return thresholdManagementMapper.deleteThresholdManagementById(id);
    }

    /**
     * 查询阈值管理集合
     *
     * @param thresholdManagement 阈值管理
     * @return 阈值管理
     */
    @Override
    public ThresholdManagement selectThresholdManagement(ThresholdManagement thresholdManagement)
    {
        return thresholdManagementMapper.selectThresholdManagement(thresholdManagement);
    }
}
